<?php
	require_once("math_replace.php");
    $Porcent = 10;
    $Cadena = "The result of [[40+15]*2] + $Porcent% IS (((40+15)*2)+ $Porcent%)";
	$ObjSalida = new MATH_REPLACE();
	$Salida = $ObjSalida->replace($Cadena);
    echo $Salida."<br />";
    
    $Cadena = "The result of [[[90-15]*2]/4] + $Porcent% IS (((90-15)*2)/4)<br />
    			The result of [[40+15]*2] + $Porcent% IS (((40+15)*2)+ $Porcent%)<br />
    			The default result[2+2] IS (2+2)";
    $Salida = $ObjSalida->replace($Cadena);
   echo $Salida."<br />";
    
    $default = $ObjSalida->replace();
    echo "The default result(2+2) IS $default<br />"; 
?>